let baseURL = 'https://www.didigolf.top/'; // 测试 - 'https://www.dicard.cn/'  正式 -  https://www.didigolf.top/
let imgPathUrl = "http://www.didisport.cn/public/"; 
let util = require('../utils/util.js')
exports.baseURL = baseURL; // 接口路径
exports.imgPathUrl = imgPathUrl; // 图片路径
// 城市定位
exports.locationPosition = (latitude, longitude, callback) => {
  wx.request({
    url: 'https://api.map.baidu.com/geocoder/v2/?ak=mnap0TSqAyYYVZ1cSHyt2QRVuY3wxTmQ&location=' + latitude + ',' + longitude + '&output=json',
    data: {},
    header: {
      'Content-Type': 'application/json'
    },
    success: function (res) {
      // success        
      var city = res.data.result.addressComponent.city;
      callback(city)
    },
    fail: function (err) {
      page.setData({ currentCity: "获取定位失败" });
    },

  })
}

exports.login = (code,callback) =>  { // 登陆返回openid
  wx.request({
    url: 'https://www.didigolf.top/Smallprogram/Login/login',   //https://www.didigolf.top/    https://www.didiyundong.com
    data: {
      code: code
    },
    header: {
      'Content-Type': 'application/json'
    },
    success: function (res) {
     callback(res)
    },
    fail: function (err) {
      callback(err)
    }

  })
}
// exports.register = (data, callback) => { // 提交用户信息  注册
//   wx.request({
//     url: baseURL+ '/Smallprogram/Login/index',
//     data: data,
//     header: {
//       "Content-Type": "application/x-www-form-urlencoded"
//     },
//     method: 'POST',
//     success: function (res) {
//       callback(res)
//     },
//     fail: function (err) {
//       callback(err)
//     }
//   })
// }
exports.particulars = (data, callback)=>{
  wx.request({
    url: baseURL + 'Community/Booking/particulars',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.getList = (data, callback) => {   // 订场列表
  wx.request({
    url: baseURL + 'Community/Booking/index',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.orderwe = (data, callback) => {//付款
  wx.request({
    url: baseURL + 'Community/order/orderwe',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.bookingDetails = (data, callback) => {//我的订场详情
  wx.request({
    url: baseURL + 'Community/Users/bookingdetails',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.index = (data, callback) => { // 首页数据
  wx.request({
    url: baseURL + 'Community/index/newindex',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
      console.log(res.data.code == 20001);
      if(res.data.code == 20001){
        wx.redirectTo({
          url: '/pages/indexde/index?url=1',
        })
      }
    },
    fail: function (err) {
      callback(err)
    }
  })
}


exports.indexSearch = (data, callback) => { // 搜索框
  wx.request({
    url: baseURL + '/Community/Venue/index',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.indexCity = (callback) => { // 城市数据
  wx.request({
    url: baseURL + '/Community/Index/regionM',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.indexForm = (data,callback) =>{  //提交表单
    wx.request({
      url: baseURL + '/Community/index/from',
      header: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'token': wx.getStorageSync('token').token || {}
      },
      data:{
        type:data.type,
        mobile: data.mobile
      },
      method: 'POST',
      success: function (res) {
        callback(res)
      },
      fail: function (err) {
        callback(err)
      }
    })
}

exports.courseDetails = (data,callback) => { // 课程详情
  console.log(wx.getStorageSync('token').token, '课程详情数据');
  wx.request({
    url: baseURL + '/Community/Branch/newindex',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.timeBooking = (data, callback) => { // 定场选择时间
  wx.request({
    url: baseURL + '/Community/Booking/bookingtime',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.subscribe = (data, callback) => { // 订场预约等待
  wx.request({
    url: baseURL + '/Community/Booking/subscribe',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.venue = (data,callback) => { // 找场馆
  console.log(wx.getStorageSync('token').token, '找场馆数据');
  wx.request({
    url: baseURL + '/Community/Venue/index',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data:data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.venueSearch = (data, callback) => { // 场馆搜索
  wx.request({
    url: baseURL + '/Community/Venue/index',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.vennueDetails = (data, callback) => { // 场馆详情
  console.log(wx.getStorageSync('token').token, '场馆详情数据', data);
  wx.request({
    url: baseURL + '/Community/Venue/details',
    data:data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
 }

// 获取用户手机号接口
 exports.getPhoneNumber = (data, callback) => {
   wx.request({
     url: baseURL + '/Community/Order/newdecrypt',
     data: data,
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 }
// 获取评测结果接口
//  exports.parenting = (data, callback) => { 
//    wx.request({
//      url: baseURL + '/smallprogram/plan/personal',
//      data: data,
//      header: {
//        'Content-Type': 'application/x-www-form-urlencoded',
//        'token': wx.getStorageSync('token').token || {}
//      },
//      method: 'POST',
//      success: function (res) {
//        callback(res)
//      },
//      fail: function (err) {
//        callback(err)
//      }
//    })
//  } 

// 支付订单接口
 exports.order = (data, callback) => {
   console.log(data);
   wx.request({
     url: baseURL + '/Community/Order/index', 
     data: data,
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 // 支付交钱接口
 exports.play = (data, callback) => {  //   Smallprogram/Order/discount
 console.log(data);
   wx.request({
     url: baseURL + data.url,
     data: data,
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 // 我的信息接口
 exports.my = (callback) => {
   wx.request({
     url: baseURL + '/Community/Users/index',
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 // 我的订单接口
 exports.orderForm = (data, callback) => {
   wx.request({
     url: baseURL + '/Community/Users/order',
     data: data,
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 // 我的订单接口
 exports.cancelOrder = (ordrrId, callback) => {
   wx.request({
     url: baseURL + '/Community/Users/cancelorder',
     data: {
       order_id: ordrrId
     },
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 // 订单详情 
 exports.orderDetails = (ordrrId, callback) => {
   wx.request({
     url: baseURL + '/Community/Users/details',
     data: {
       order_sn: ordrrId
     },
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 
 //意见反馈提交
 exports.feedback = (feeddata, callback) => {
   wx.request({
     url: baseURL + '/Community/Users/proposal',
     data: feeddata,
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 //个人资料补充提交
 exports.meForm = (data, callback) => { 
   wx.request({
     url: baseURL + '/Community/person/personAdd',
     data: data,
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 //个人资料选择框数据
 exports.meData = (callback) => {
   wx.request({
     url: baseURL + '/Community/person/personList',
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 } 

 exports.FAQ = (callback => { //找滴仔问题
   wx.request({
     url: baseURL + '/Community/hcate/question',
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 })


 exports.FAQData = (data, callback) => { //找滴仔问题详情
   wx.request({
     url: baseURL + '/Community/hcate/answer',
     data: {
       id: data
     },
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err)
     }
   })
 }

 exports.F9F = (data,callback) =>{   // 9.9活动
 console.log(data);
    wx.request({
      url: baseURL + '/Community/Horse/activePay',
      header: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'token': wx.getStorageSync('token').token || {}
      },
      data:{
        active_num: data.num,
        mobile: data.mobile,
        join_names: data.name,
        openid_wechat:data.openid_wechat
      },
      method:'POST',
      success:function(res){
        callback(res)
      },
      fail: function (err) {
        callback(err);
      }
    })
 }

 exports.F9FSucce = (data, callback)=>{  //9.9活动支付成功
   wx.request({
     url: baseURL + '/Community/Horse/successurl',
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token || {}
     },
     method: 'POST',
     data: {
       order_sn: data.order,
     },
     success: function (res) {
       callback(res)
     },
     fail: function (err) {
       callback(err);
     }
   })
 }

 exports.Coupon = (data,callback) =>{  // 我的优惠券
  wx.request({
    url: baseURL + '/Community/Users/discount',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    method: 'POST',
    data:{
      type:data.type
    },
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err);
    }
  })
 }

 exports.PayCoupon = (data,callback) =>{  // 支付优惠券
    wx.request({
      url: baseURL + '/Community/Order/thecoupons',
      header: {
        'Content-Type': 'application/x-www-form-urlencoded',
        'token': wx.getStorageSync('token').token || {}
      },
      method: 'POST',
      data:{
        discount_id: data.Discount_id,
        k_id: data.Kid
      },
      success: function (res) {
        callback(res)
      },
      fail: function (err) {
        callback(err);
      }
    })
 }

 exports.PaySelect = (data,callback) =>{   // 支付选择
  wx.request({
    url: baseURL + '/Community/Order/discount' ,
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(res) {
      callback(res)
    },

  })
 }
 exports.PayCard = (data,callback) =>{   // 支付卡片
  wx.request({
    url: baseURL + '/Community/order/tkorder' ,
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function(res) {
      callback(res)
    },
    fail: function(res) {
      callback(res)
    },

  })
 }
 exports.Share = (data,callback) =>{ // 个人中心转发
   wx.request({
     url: baseURL + '/Community/users/invitefriends',
     data:data,
     header: {
       'Content-Type': 'application/x-www-form-urlencoded',
       'token': wx.getStorageSync('token').token
     },
     method: 'POST',
     success: function (res) {
       callback(res)
     },
     fail: function (res) {
       callback(res)
     },
   })
 }

exports.communityIndex = (data, callback) =>{  //社区首页
console.log(data)
  wx.request({
    url: baseURL + 'Community/Community/newindex',
    data:data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.Refresh = (data, callback) => {  //社区刷新首页
  console.log(data)
  wx.request({
    url: baseURL + '/Community/Community/newindex',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.communityActive = (data,callback) =>{  // 文章详情接口
  wx.request({
    url: baseURL + 'Community/Community/activities',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.comment = (data,callback) =>{  //评论
  wx.request({
    url: baseURL + 'Community/Community/comment',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.commentList = (data, callback) =>{ //更多评论
  wx.request({
    url: baseURL +  'Community/Community/allcomments',
    data:data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.commentRemove = (data,callback) =>{ //删除评论
console.log(data)
  wx.request({
    url: baseURL + 'Community/Community/commentDelect',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.Sport = (callback) =>{ //  发布展示数据
  wx.request({
    url: baseURL+'Community/Community/note',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.addNote =(data,callback)=>{// 上传
console.log(data)
  wx.request({
    url: baseURL +'/Community/Community/addNote',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    },
  })
}

exports.myUsers=(callback)=>{ // 我的笔记
  wx.request({
    url: baseURL +'Community/users/essay',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.myRemove=(data,callback) =>{ //删除文章
  wx.request({
    url: baseURL +'Community/Users/essayDelete',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  
  })
}

exports.indexS = (data,callback) =>{ //首页
  wx.request({
    url: baseURL +  'Community/Interest/index',
    data:data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.classify = (data,callback) =>{ //兴趣全部分类
  wx.request({
    url: baseURL + 'Community/Interest/classify',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.sportRim = (data,callback) =>{ //运动缘接口1
  wx.request({
    url: baseURL + 'community/Cate/label', 
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.goal = (data, callback) => {//运动缘接口2
  console.log(data)
  wx.request({
    url: baseURL + 'community/Cate/opt',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.index99 = (data,callback)=>{ //首页兴趣9.9模块
  wx.request({
    url: baseURL + 'Community/Interest/activity',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.Leisure = (data, callback) => { //限时特惠
  wx.request({
    url: baseURL + 'Community/Interest/preferential',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.channel = (data, callback) => { // 分类
  wx.request({
    url: baseURL + 'Community/Interest/channel',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.quality = (data, callback) => {  //标签接口
  wx.request({
    url: baseURL + 'Community/Notetext/index',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.all = (data,callback) =>{
  wx.request({
    url: baseURL + 'Community/Cate/desc',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.like = (data,callback) =>{  //点赞
  wx.request({
    url: baseURL + 'Community/Note/praise',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.booking = (data, callback) => {  //订场列表接口
  wx.request({
    url: baseURL + 'Community/Booking/index',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
      console.log(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.yuyue = (data, callback) => {  //预约时间接口
  wx.request({
    url: baseURL + 'Community/Booking/subscribe',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
      console.log(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}


exports.liebiao = (data, callback) => {  //订场列表接口
  wx.request({
    url: baseURL + 'Community/Users/userbooking',
    data: data,
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token
    },
    method: 'POST',
    success: function (res) {
      callback(res)
      console.log(res)
    },
    fail: function (res) {
      callback(res)
    }
  })
}

exports.reservation = (data, callback) => {//取消预约
  wx.request({
    url: baseURL + 'Community/Booking/reservation',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

exports.zhifu = (data, callback) => { //支付
  wx.request({
    url: baseURL + 'Community/order/orderwe',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}
exports.huiyuanzhifu = (data, callback) => { // 0元支付
  wx.request({
    url: baseURL + 'Community/Order/zeropay',
    header: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'token': wx.getStorageSync('token').token || {}
    },
    data: data,
    method: 'POST',
    success: function (res) {
      callback(res)
    },
    fail: function (err) {
      callback(err)
    }
  })
}

